var Adv_skd=require("./Adv_skd2")

cc.Class({
  extends: cc.Component,
  properties: {},
  initBy: function (t) {
    Adv_skd.default.instance.hideAllAdv();

    Adv_skd.default.instance.showInterstitialAd();
    Adv_skd.default.instance.showGridAdTop();
    Adv_skd.default.instance.showBannerAd();
    this.scene = t;
  },
  onClickClose: function () {
    cc.popupManager.removePopup(this);
    Adv_skd.default.instance.hideAllAdv();
  },
  onClickAd: function () {
    Adv_skd.default.instance.hideAllAdv();

    var t = this;
    cc.pvz.AdUtils.showAdRewardVideo(cc.pvz.GameConfig.AdType.怒气不足, function (e) {
      if (e) {
        cc.pvz.runtimeData.angerAdCount--;
        cc.pvz.runtimeData.anger = Math.min(1e3, cc.pvz.runtimeData.anger + 500);
        t.scene.updateAnger();
        cc.popupManager.removePopup(t);
      }
    });
  }
});